package priv.pront.code.robot.roboCom_pri_2021.zhi.fu;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-07-13 15:28
 */
public class PAT基础级排名 {

    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);
    static int n, m, pre, r = 1, cnt = 1,t;
    static int[] a = {0, 30, 50, 60, 80, 100};

    static List<Info> list = new ArrayList<>();

    static class Info {
        public String no;
        public int s;
        public int t;
        public int f;
        public int r;
        public int level;

        public Info(String no, int score) {
            this.no = no;
            this.s = score;
        }
    }

    public static void main(String[] args) throws IOException {
        String[] s = bf.readLine().split(" ");
        n = Integer.parseInt(s[0]);
        m = Integer.parseInt(s[1]);
        pre = m;
        t = n;
        for (int i = 0; i < n; i++) {
            String[] ss = bf.readLine().split(" ");
            list.add(new Info(ss[0], Integer.parseInt(ss[1])));
        }
        list.sort(new Com());
        for (int i = 0; i < n; i++) {
            boolean flag = false;
            Info cur = list.get(i);
            int level = 0;
            int tt = m;
            int score = cur.s;
            if (score > 0) {
                while (tt >= 0) {
                    if (score > a[tt - 1] && score <= a[tt]) {
                        level = tt;
                        break;
                    }
                    tt--;
                }
            }
            if(level != pre){
                pre = level;
                cnt = 1;
                r = 1;
                t  = n - i ;
                flag = true;
            }
            if(i != 0 && score == list.get(i - 1).s){
                r = list.get(i - 1).r;
                cnt++;
            }else if(i != 0 && !flag){
                r = list.get(i - 1).r + cnt;
                cnt = 1;
            }
            cur.r = r;
            cur.level = level;
            cur.f = a[level];
            cur.t = t;
        }

        for (int j = 0; j < n; j++) {
            Info cur = list.get(j);
            if(cur.s == 0){
                out.println(cur.no);
                out.flush();
            }else{
                out.println(cur.no + " " + cur.level + " " + cur.s + "/" + cur.f + " " + cur.r + "/" + cur.t);
                out.flush();
            }
        }
        out.close();
    }

    public static class Com implements Comparator<Info> {

        @Override
        public int compare(Info o1, Info o2) {
            if (o1.s != o2.s) {
                return o2.s - o1.s;
            }
            return o1.no.compareTo(o2.no);
        }
    }
}
